package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"gorm/control"
	"gorm/model"
)

func main() {
	err := model.InitDb()
	if err != nil {
		fmt.Printf("链接服务器失败%s",err.Error())
		return
	}
	err = model.InitRedis();
	if err != nil {
		fmt.Printf("redis连接失败%s",err.Error())
		return
	}
	r := gin.Default()
	r.Use(control.Cors())
	r.Static("/static", "./static")
	r.Use(control.TokenValidate())
	control.SetRouter(r)
	r.Run(":9999");
}
